﻿using DNFImagePacks2Manager.Controls;
using DNFImagePacks2Manager.Helpers;
using DNFImagePacks2Manager.Models;
using Microsoft.UI.Xaml.Controls;
using System.Collections.Generic;

namespace DNFImagePacks2Manager.QuickTool.Models
{
    public abstract class QuickToolBase : PinYinItem
    {
        public string Description { get; set; }

        public List<string> Author { get; set; } = [];

        public QuickToolBase(string name, string desc)
        {
            Name = name;
            Description = desc;
        }

        public virtual Dictionary<string, string> GetInfo()
        {
            Dictionary<string, string> infos = [];
            infos.Add("工具名称", Name);
            infos.Add("功能描述", Description);
            infos.Add("工具作者", string.Join(",", Author));
            return infos;
        }

        public void Info(Page page)
        {
            var dictionaryView = new DictionaryViewDialog();
            dictionaryView.SetDictionary(GetInfo());

            DialogHelper.ShowNormalDialog(page, $"{Name}", dictionaryView);
        }

        public abstract void OpenUsePage(Page page);

    }
}
